<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>
  <el-dialog width="1000px" :visible="visible" append-to-body :close-on-click-modal="true" :title="title"
    @updateVisible="updateVisible">
    <div>
      <qiniuVue v-if="uploadosstype == '1'" :checkFun="checkFun" :max="max" :multiple="multiple" @done="reloadFile" />
<!--      <tianyiyunVue v-else :checkFun="checkFun" :max="max" :multiple="multiple" @done="reloadFile" :mime='mime' />-->
    </div>
  </el-dialog>
</template>

<script>
import qiniuVue from './qiniu.vue';
// import tianyiyunVue from './tianyiyun.vue';
export default {
  name:'bigdataupload',
  components: { qiniuVue },
  props: {
    uploadosstype: { uploadosstype: String, default: '1' },
    name: { type: String, default: '' },
    checkFun: {
      type: Function,
      default: function () {
        return true;
      }
    },
    max: { type: Number, default: 1610612736 },
    mime: { type: String }, //后台限制的文件格式
    multiple: { default: true },
    visible: Boolean
  },
  data() {
    return {
      title: this.uploadosstype == '1' ? '七牛上传' : '天翼云上传'
    };
  },
  mounted() {
    //   this.title = this.title + '_' + this.name;
  },
  methods: {
    reloadFile(file_name, file_ext, file_size, file_path) {
      this.$emit('done', file_name, file_ext, file_size, file_path);
      console.log(file_name, file_ext, file_size, file_path)
    },
    /* 更新visible */
    updateVisible(value) {
      this.$emit('onUpdateVisible', value);
    }
  }
};
</script>
<style lang="scss" scoped></style>
